package eraserhead.xml.response;

import org.w3c.dom.Node;

import xml.Message;
import client.IMessageHandler;
import eraserhead.xml.XmlNode;

/**
 * Response handler for Force
 * @author Michael Checca
 */
public class ForceResponse implements IMessageHandler {

	@Override
	public void process(Message response) {
		Node remove = XmlNode.findNode(response.contents, "forceResponse");
		if (remove != null) {
			int numberAffected = Integer.parseInt(XmlNode.getAttribute(remove, "numberAffected"));
			System.out.println(String.format("Force response received [numberAffected: %d]",
					numberAffected));
		}
	}
}
